package com.ytkj.digitalConstruction;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;

import com.ytkj.digitalConstruction.aspect.HTTPBearerAuthorizeAttribute;

/**
 * 拦截器
 * 
 * @author iking
 *
 */
@SpringBootApplication
public class DigitalConstructionApplication extends SpringBootServletInitializer {

	/**
	 * @功能描述 注册拦截器
	 */
	@Bean
	public FilterRegistrationBean jwtFilter() {
		final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
		registrationBean.setFilter(new HTTPBearerAuthorizeAttribute());
		registrationBean.addUrlPatterns("/*");
		return registrationBean;
	}

	public static void main(String[] args) {
		SpringApplication.run(DigitalConstructionApplication.class, args);
	}
}
